package com.qf.springboot.controller;

import com.qf.springboot.mapper.UserMapper;
import com.qf.springboot.pojo.Details;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/test")
public class TestController {

    private UserMapper userMapper;

    @Autowired
    public void setUserMapper(UserMapper userMapper){
        this.userMapper = userMapper;
    }

    @GetMapping("/test1")
    public String test1(){
        return "kjhfiaff";
    }

    @GetMapping("/all")
    public List<Details> test2(){
        return userMapper.findAll();
    }
}
